package com.example.myapplication_2.celebrity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


import com.example.myapplication_2.Main_Activity;
import com.example.myapplication_2.R;
import com.example.myapplication_2.a600_xm.Buy_Activity;
import com.example.myapplication_2.a600_xm.bean.Yao;
import com.example.myapplication_2.a600_xm.utils.JSONUtils;

import java.util.HashMap;

public class Celebrity_main extends Activity {
    private Button qtea_2;
    private static HashMap<String, String> qingcha = new HashMap<>();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.celebrity_main);
        qtea_2 = (Button) findViewById(R.id.qtea_2);
        qtea_2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Yao yao = new Yao();
                yao.setKey1("粉葛根");
                yao.setKey2("薄荷");
//                yao.setKey3();
//                yao.setKey4();
                String tojson = JSONUtils.tojson(yao);

                // 给but_fan添加点击响应事件
                Intent intent = new Intent(Celebrity_main.this, Buy_Activity.class);
                intent.putExtra("key", tojson);

                //启动
                startActivity(intent);
            }
        });

    }

    public void qingcha() {

        qingcha.put("疏风清肺代茶饮", "粉葛根,薄荷");
        qingcha.put("麦冬桑贝代茶饮", "桑叶");
        qingcha.put("和胃清肺饮", "茯苓,杏仁");
        qingcha.put("清热代茶饮", "青果,芦根");
        qingcha.put("银花扁豆代茶饮", "金银花,白扁豆,莲子");
        qingcha.put("加味三鲜饮", "山楂,麦芽,橘红");
        qingcha.put("参桂代茶饮", "人参,肉桂");
        qingcha.put("和胃代茶饮", "橘红");
        qingcha.put("枣仁淡竹饮", "酸枣仁");
        qingcha.put("安神代茶饮", "人参,酸枣仁");
        qingcha.put("保元代茶饮", "人参");
        qingcha.put("参莲饮", "人参,莲子");
    }


}
